Skip to content

Change logging functions to use Write-Host#12532

Merged
weshaggard merged 4 commits intomainfrom
weshaggard-patch-2
Oct 22, 2025
Merged

Change logging functions to use Write-Host#12532
weshaggard merged 4 commits intomainfrom
weshaggard-patch-2

Conversation

@weshaggard
Copy link
Copy Markdown
Member

Change logging helpers to always write to host and either set color or use devops/gh formatting.

We do not want to use Write-Error or Write-Warning directly because they can stop the script or not depending on preferences which makes it difficult to ensure local runs of scripts work the same as in the pipelines. So, we should never depend on these logging commands to cause a script to stop execution.

Change logging helpers to always write to host and either set color or use devops/gh formatting. 

We do not want to use Write-Error or Write-Warning directly because they can stop the script or not depending on preferences which makes it difficult to ensure local runs of scripts work the same as in the pipelines. So, we should never depend on these logging commands to cause a script to stop execution.
@weshaggard weshaggard requested a review from a team as a code owner October 16, 2025 21:11
Copilot AI review requested due to automatic review settings October 16, 2025 21:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies logging functions to consistently use Write-Host instead of Write-Error and Write-Warning to ensure predictable script execution behavior across different environments. The changes prevent scripts from potentially stopping due to PowerShell preference settings while maintaining visual distinction through color coding.

  • Replaced Write-Warning with Write-Host using yellow foreground color
  • Replaced Write-Error calls with Write-Host using red foreground color
  • Maintained existing DevOps/GitHub Actions formatting for CI/CD environments

Removed legacy error handling for command failures.
@azure-sdk
Copy link
Copy Markdown
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk
Copy link
Copy Markdown
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk
Copy link
Copy Markdown
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

azure-sdk added a commit to Azure/azure-sdk-for-js that referenced this pull request Oct 22, 2025
Sync eng/common directory with azure-sdk-tools for PR
Azure/azure-sdk-tools#12532 See [eng/common
workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow)

---------

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
azure-sdk added a commit to Azure/azure-sdk-for-rust that referenced this pull request Oct 22, 2025
Sync eng/common directory with azure-sdk-tools for PR
Azure/azure-sdk-tools#12532 See [eng/common
workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow)

---------

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
@weshaggard weshaggard enabled auto-merge (squash) October 22, 2025 16:49
@weshaggard weshaggard merged commit 05a99a8 into main Oct 22, 2025
10 checks passed
@weshaggard weshaggard deleted the weshaggard-patch-2 branch October 22, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants